/**
 * 
 */
package action;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import pojo.Alarm;
import service.UserService;
import service.impl.UserServiceImpl;

/**
 * @author chenguanshen
 *2016年7月23日
 */
public class ReturnAlarmAction extends ActionSupport{
	private Alarm alarm = new Alarm();
	private UserService userService =new UserServiceImpl();
	private String username;
	

	public String queryAllAlarm(){

		List<Alarm> list = userService.queryAllAlarm(username);
		
		System.out.println(list.toString());
		if(list!=null || list.size()>0){
			//放入request域
			ActionContext.getContext().put("list", list);
			return "alarmList_success";
		}else{
			return "alarmList_false";
		}
		
		
	}
	

	public Alarm getAlarm() {
		return alarm;
	}
	public void setAlarm(Alarm alarm) {
		this.alarm = alarm;
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

}
